package com.test.controller;


import org.springframework.web.servlet.ModelAndView;
//import org.springframework.web.servlet.mvc.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by: zs
 * Date-Time: 2017/8/9 19:05
 */

@Controller
public class WelcomeController{
    @RequestMapping(value = "/login")  //通过spring注解来映射方法和url
    public String login(){
        return "login";
    }

    @RequestMapping(value = "/loginCheck")
    public ModelAndView loginCheck(HttpServletRequest httpServletRequest,LoginInfo loginInfo) throws  Exception{
        //System.out.print(loginInfo.getUserName());
        //System.out.print(loginInfo.getPassword());
        return new ModelAndView("welcome");
    }
}
//public class WelcomeController implements Controller {
//
//    @Override
//    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
//        System.out.println("welcome123");
//        return new ModelAndView("login");
//    }
//}
